﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SelectBlock.aspx.cs" Inherits="Thksoft.BusinessExpansion.PublicShow.SelectBlock" %>

<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <!--懒加载模块-->
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>
    <script type="text/javascript">
        var loadConfig = {};
    </script>
    <script type="text/javascript">
        var ModalData = {
            Text: "",
            Value: ""
        };
        function FORM_SUBMIT(dataStr) {
            var data = dataStr.split('%');

            ModalData.Text = data[1];
            ModalData.Value = data[0];
            //调用 父级页面关闭页面
            var index = top.layer.getFrameIndex(window.name); //获取窗口索引
            top.$("#layui-layer" + index + " .layui-layer-close").click();
        }
        //关闭表单
        function FORM_CLOSE() {
            var index = top.layer.getFrameIndex(window.name); //获取窗口索引
            top.console.log("index:" + index);
            top.$("#layui-layer" + index + " .layui-layer-close").click();
        }
        function FORM_CLEAR() {
            document.getElementById("FORM_CHECK_VALUE_STRING").innerText("");
            document.getElementById("FORM_CHECK_VALUE").value("");
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <!--搜索模块-->
        <div id="SEARCH_MODULE">
            <input id="FORM_SEARCH_VALUE" runat="server" type="text" placeholder="请输入模板名或者ID" />
            <asp:Button ID="FORM_SEARCH" runat="server" OnClick="SearchClick" Text="搜索" />
        </div>
        <!--表单模块-->
        <div id="TABLE_MODULE">
            <div>
                <div>
                    已选择:<asp:Label ID="FORM_CHECK_VALUE_STRING" runat="server"></asp:Label>
                </div>
                <button type="button" onclick="FORM_CLEAR()">清空</button>
                <asp:HiddenField ID="FORM_CHECK_VALUE" runat="server" />
            </div>
            <div>
                <asp:GridView ID="DATA_TABLE" runat="server" AutoGenerateColumns="False" CssClass="cont_list"
                    Width="100%" EmptyDataText="没有查找到您要的数据" AllowSorting="True" OnSorting="grvShow_Sorting">
                    <Columns>
                        <asp:TemplateField HeaderText="全选">
                            <HeaderTemplate>
                                <asp:CheckBox ID="chkSelectAll" runat="server" Onclick="GetAllCheckBox(this)" />
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:CheckBox ID="chkSelectId" runat="server" ToolTip='<%#Eval("N_BLOCK_ID")%>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField HeaderText="模块编号" DataField="N_BLOCK_ID" SortExpression="N_BLOCK_ID" />
                        <asp:BoundField HeaderText="模块名称" DataField="C_BLOCK_NAME" SortExpression="C_BLOCK_NAME" />
                        <asp:BoundField HeaderText="模块路径" DataField="C_BLOCK_DEPATH" SortExpression="C_BLOCK_DEPATH" />
                        <asp:TemplateField HeaderText="备注">
                            <ItemTemplate>
                                <%#Eval("REMARK").ToString() == "" ? "无" : Eval("REMARK").ToString()%>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            </div>
            <div>
                <asp:Button Text="选择" runat="server" OnClick="CheckClick" />
            </div>
        </div>
        <!--按钮模块-->
        <div id="BUTTON_MODULE">
            <input type="button" value="确定" />
            <input type="button" onclick="FORM_CLOSE();" value="返回" />
        </div>
    </form>
</body>
</html>